/** @type { import('@storybook/vue3-vite').StorybookConfig } */
const config = {
  stories: [
    "../stories/**/*.mdx",
    "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
  ],
  addons: [
    "@storybook/addon-onboarding",
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@chromatic-com/storybook",
    "@storybook/addon-interactions",
  ],
  framework: {
    name: "@storybook/vue3-vite",
    options: {},
  },
  async viteFinal(config, { configType }) {
    // configType 会是 'DEVELOPMENT' 或 'PRODUCTION'
    // 你可以在这里导入并合并你自己的 vite.config.js
    const { mergeConfig } = require('vite');
    const viteConfig = require('../vite.config');
    return mergeConfig(config, viteConfig);
  },
};

export default config;